import Vue from 'vue'

import App from './App'
import router from './routers'
import store from './store'
import { sync } from 'vuex-router-sync'

import './assets/css/index.less'

import Vant from 'vant'
import 'vant/lib/vant-css/index.css'
import 'vant/lib/vant-css/icon-local.css'

import filters from '@/plugins/filters'

Vue.use(filters)
Vue.use(Vant)

Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

sync(store, router)
new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: { App }
})
